﻿using System.ComponentModel.DataAnnotations;
using ZeroSum.Attributes;
using ZeroSum.Domain.Entities;
using ZeroSum.IdGenerator;

namespace ZeroBlog.Core.Domains.Blog
{
    [Entity]
    public class Post : BaseAggregateRoot<long>, ISoftDelete
    {
        public Post()
        {
            Id = IDGenerator.Generate();
        }
        [Required]
        public string Title { get; set; } = string.Empty;
        [Required]
        public string Content { get; set; } = string.Empty;
        public string? Description { get; set; } = string.Empty;
        public string? CoverImgUrl { get; set; }
        public int Views { get; set; } = 0;
        public long CategoryId { get; set; }
        [Required] public virtual Category? Category { get; set; } = null;
        public int Likes { get; set; } = 0;
        public bool IsDeleted { get; set; }
    }
}
